from bs4 import BeautifulSoup

soup = BeautifulSoup(open('../素材/豆瓣.html', 'r', encoding='UTF-8').read(), 'lxml')
# print(soup)

li_list = soup.find('ul', class_="cover-col-4 clearfix").findAll('li')
# print(li_list)

for li in li_list:
    # print(li)
    # print(li.a.img)  # 获取封面
    # print(li.div.h2.a.string)  # 获取标题
    # print(''.join(list(li.div.p.stripped_strings)))  # 获取评分
    print(li.div.p.find_all('span')[1].string)  # 获取评分